package com.j2bugzilla.base;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;


public class BugHistoryDetail {
	
	private List<History> history;
	private String alias;
	private Integer id;

	public BugHistoryDetail() {
		this.history = new ArrayList<BugHistoryDetail.History>();
	}
	
	public BugHistoryDetail(Integer id, String alias) {
		this();
		this.id = id;
		this.alias = alias;
	}
	
	public void addHistory(History history) {
		this.history.add(history);
	}
	
	public List<History> getHistory() {
		return history;
	}

	public void setHistory(List<History> history) {
		this.history = history;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public static class Change {

		private Integer attachmentId;
		private String added;
		private String removed;
		private String fieldName;

		public void setFieldName(String fieldName) {
			this.fieldName = fieldName;
		}

		public void setRemoved(String removed) {
			this.removed = removed;
		}

		public void setAdded(String added) {
			this.added = added;
		}

		public void setAttachmentId(Integer attachmentdId) {
			this.attachmentId = attachmentdId;
		}

		public Integer getAttachmentId() {
			return attachmentId;
		}

		public String getAdded() {
			return added;
		}

		public String getRemoved() {
			return removed;
		}

		public String getFieldName() {
			return fieldName;
		}
		
	}
	
	public static class History {
		private List<Change> change;
		private Date when;
		private String who;

		public History() {
			change = new ArrayList<BugHistoryDetail.Change>();
		}
		
		public void setWhen(Date when) {
			this.when = when;
		}

		public void setWho(String who) {
			this.who = who;
		}

		public void addChange(Change change) {
			this.change.add(change);
		}

		public List<Change> getChange() {
			return change;
		}

		public void setChange(List<Change> change) {
			this.change = change;
		}

		public Date getWhen() {
			return when;
		}

		public String getWho() {
			return who;
		}
	}
}
